package com.hollycrm.hollysqm.core.waveform.plot;

import java.awt.GraphicsConfiguration;
import java.awt.HeadlessException;

import com.hollycrm.hollysqm.core.waveform.plot.model.DrawableObject;


public class PlotFrame {
    private static final long serialVersionUID = 1L;
    private PlotPanle plotPanle = null;
    private boolean iv = true;
    private String title = "";

    public PlotFrame()
            throws HeadlessException {
        commonInit();
    }

    public PlotFrame(GraphicsConfiguration gc) {
        //super(gc);
        commonInit();
    }

    public PlotFrame(String title, GraphicsConfiguration gc) {
        //super(title, gc);
        commonInit();
    }

    public PlotFrame(String title, boolean isVisible) throws HeadlessException {
        // super(title);
        this.iv = isVisible;
        commonInit();
    }

    public PlotFrame(String title) throws HeadlessException {
        //super(title);
        commonInit();
    }

    private void commonInit() {
        this.plotPanle = new PlotPanle();
        //add(this.plotPanle);
        // setSize(300, 200);
        // setLocationRelativeTo(null);
        // addWindowListener(new WindowAdapter()

    }

    public void setHoldOn(boolean holdOn) {
        this.plotPanle.setHoldOn(holdOn);
    }

    public void plot(DrawableObject drawableObject) {
        this.plotPanle.plot(drawableObject);
    }

    public void axis(double sx, double ex, double sy, double ey) {
        this.plotPanle.axis(sx, ex, sy, ey);
    }

    public void suit() {
        this.plotPanle.suit();
    }

    public PlotPanle getPlotPanle() {
        return plotPanle;
    }

    public void setPlotPanle(PlotPanle plotPanle) {
        this.plotPanle = plotPanle;
    }

    public boolean isIv() {
        return iv;
    }

    public void setIv(boolean iv) {
        this.iv = iv;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }
}
